/*func (m *Map) Store(key, value interface{})	存储key-value数据
func (m *Map) Load(key interface{}) (value interface{}, ok bool)	查询key对应的value
func (m *Map) LoadOrStore(key, value interface{}) (actual interface{}, loaded bool)	查询或存储key对应的value
func (m *Map) LoadAndDelete(key interface{}) (value interface{}, loaded bool)	查询并删除key
func (m *Map) Delete(key interface{})	删除key
func (m *Map) Range(f func(key, value interface{}) bool)	对map中的每个key-value依次调用f*/

package main

import (
	"fmt"
	"strconv"
	"sync"
)

var m1 sync.Map = sync.Map{} // 要初始化
func main() {
	var wg sync.WaitGroup
	for i := 0; i < 10; i++ {
		wg.Add(1)
		go func(n int) {
			key := strconv.Itoa(n)
			m1.Store(key, n)
			res, _ := m1.Load(key)
			fmt.Printf("key为：%s，value为：%d\n", key, res)
			wg.Done()
		}(i)

	}
	wg.Wait()
	//报错：fatal error: concurrent map writes

}
